Suicide prevention is a significant public health priority. We have made great strides in understanding risk factors for suicidal behavior using conventional statistical methods; however prediction of suicidal behavior in practice remains poor. In 2014, NIMH and the National Action Alliance for Suicide Prevention Research Prioritization Task Force published A Prioritized Research Agenda for Suicide Prevention: An Action Plan to Save Lives, which identified six key unanswered questions about suicide. The proposed project addresses the key unanswered question of how can we better or more optimally detect/predict risk? from the report. Specifically, the project addresses the following short and long term objectives associated with this unanswered question: (1) developing risk algorithms from health care data that can be used for suicide risk detection and (2) overcoming base rate challenges and response bias by identifying innovative biostatistical and other research methods. Recent advances in statistical methodology, including the application of machine learning methods in psychiatry, will allow us to capitalize on what has been learned from previous studies to propel forward our ability to predict suicidal behavior. The aims of this study are to examine immediate and long-term risk factors of three separate suicidal behavior outcomes including (a) suicidal ideation, (b) suicide attempt and (c) death from suicide to develop general population risk algorithms and elucidate novel interactions, both overall and among high risk subgroups. Further, we will use regression-based analyses to quantify the main effects of predictor variables and novel interactions. Study Design: This series of case-control studies will use machine learning to identify risk algorithms for suicidal behavior in the population of Denmark from 1994-2015. Extensive data on psychiatric and somatic diagnoses, prescriptions, social variables, and mortality have been routinely and rapidly recorded in national registries in Denmark for decades, allowing for the thorough examination of longitudinal predictors and the efficient examination of low base rate outcomes. Gender differences will be explored, as well as algorithms among high risk subgroups of the population (e.g., groups with psychiatric diagnoses). Implications: The current study addresses NIMH's research priorities of 1) charting mental illness trajectories to determine when, where, and how to intervene and 2) strengthening the public health impact of NIMH- supported research. This work will inform clinicians and policymakers regarding the patient groups that may benefit most from both universal and selected suicide intervention and prevention efforts. In future work, risk algorithms developed as part of this study can be validated in other populations, used as the basis for a more detailed exploration of newly discovered interactions that increase suicidal behavior risk, and ultimately develop deployable screening tools that can identify patients at risk for suicidal behavior.